package com.supermap.dubbo.iot;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject;
import com.supermap.dubbo.service.IotDubboService;
import org.springframework.stereotype.Component;

/**
 * @author xiaolu
 * @date 2018/6/8 上午9:45
 */
@Component
public class IotDubboConsumerService {
    @Reference(version = "1.0.0")
    IotDubboService iotDubboService;

    public JSONObject isValid(String userName, String password, boolean isUseMD5) {
        return iotDubboService.isValid(userName, password, isUseMD5);
    }

    public JSONObject getRegions(String userName, String password, boolean isUseMD5) {
        return iotDubboService.getRegions(userName, password, isUseMD5);
    }

    public JSONObject getWeatherPointsByRegionId(String userName, String password, boolean isUseMD5, int regionId) {
        return iotDubboService.getWeatherPointsByRegionId(userName, password, isUseMD5, regionId);
    }

    public JSONObject getWeatherPointsByBMId(String userName, String password, boolean isUseMD5, int bmId) {
        return iotDubboService.getWeatherPointsByBMId(userName, password, isUseMD5, bmId);
    }

    public JSONObject getNodesByRegionID(String userName, String password, boolean isUseMD5, int regionId) {
        return iotDubboService.getNodesByRegionID(userName, password, isUseMD5, regionId);
    }

    public JSONObject getNodesByBMID(String userName, String password, boolean isUseMD5, int bmId) {
        return iotDubboService.getNodesByBMID(userName, password, isUseMD5, bmId);
    }

    public JSONObject getMonitorCategories(String userName, String password, boolean isUseMD5, int nodeId) {
        return iotDubboService.getMonitorCategories(userName, password, isUseMD5, nodeId);
    }

    public JSONObject getEnvInfosByStat(String userName, String password, boolean isUseMD5, int nodeId, String time, int type) {
        return iotDubboService.getEnvInfosByStat(userName, password, isUseMD5, nodeId, time, type);
    }

    public JSONObject getEnvInfoDetails(String userName, String password, boolean isUseMD5, int nodeId) {
        return iotDubboService.getEnvInfoDetails(userName, password, isUseMD5, nodeId);
    }

    public JSONObject getDevices(String userName, String password, boolean isUseMD5, int nodeId) {
        return iotDubboService.getDevices(userName, password, isUseMD5, nodeId);
    }

    public JSONObject sendDeviceCommand(String userName, String password, boolean isUseMD5, int deviceId, int openType) {
        return iotDubboService.sendDeviceCommand(userName, password, isUseMD5, deviceId, openType);
    }


    public JSONObject sendDeviceCommandDetail(String userName, String password, boolean isUseMD5, int deviceId, int openType, int ctrTime, int ctrIntensity) {
        return iotDubboService.sendDeviceCommandDetail(userName, password, isUseMD5, deviceId, openType, ctrTime, ctrIntensity);
    }

    public JSONObject getMapInfo(String userName, String password, boolean isUseMD5, int regionId, int type, String code) {
        return iotDubboService.getMapInfo(userName, password, isUseMD5, regionId, type, code);
    }

}
